﻿@model List<RentalSystem.Data.EF.Hires>
@{
    ViewBag.Title = "Index";
    Layout = "~/Views/Shared/CustomerLayout.cshtml";
}

<h2>Strefa klienta</h2>

<ul class="iconsMenu">
    <li><a href="@Url.Action("RentHistory", "Customers")" class="rentIcon">Wypożyczenia</a></li>
    <li><a href="@Url.Action("RentCash", "Customers")" class="financeIcon">Należności</a></li>
    <li><a href="@Url.Action("History", "Customers")" class="logsIcon">Historia</a></li>
    <li><a href="@Url.Action("Settings", "Customers")" class="settingsIcon">Ustawienia</a></li>
</ul>

<h3>Aktualnie wypożyczone filmy</h3>

@if (Model != null && Model.Count > 0)
{
    foreach (Hires hire in Model)
        {
            string styleId = string.Empty;
            switch (hire.Discs.DiscTypes.DiscTypeName)
            {
                case "DVD": styleId = "discDVD";
                    break;
                case "Blue-Ray": styleId = "discBlueray";
                    break;
                case "HD DVD": styleId = "discHDDVD";
                    break;
                default: styleId = "discCD";
                    break;
            }

            var href = String.Format("http://{0}/movie/{1}/details", Request.Url.Host, hire.Discs.MovieGuid);
            <a href="@href" class="DiscListItem @styleId" style="width: 200px; height: 80px;">
                <p>@hire.Discs.Movies.MovieTitle</p>
                <p>Zwrot: @hire.HirePlanningReturningDate.Value.ToString("dd.MM.yyyy")</p>
            </a>
        } 
}
else
{
    <p>Nie wypożyczasz żadnych filmów</p>
}